package com.cmccsi.uc.redis;

import com.cmccsi.uc.session.PresenceSubscriber;
import com.thn.netty.chat.server.ExecRedisCmdErr;

public interface ICAsyncR {
	
	//public friend void AsyncRedis_reconnect_time_cb(const int fd, const short which, void *arg);
	
	//public	CAsyncR( String server, int port, WORKER w );
	//public	CAsyncR( String server, int port );
	
	//public	virtual ~CAsyncR();

		//群组和单人的使用一个接口好了, msgType:0:单人 1:群组 返回值int代表执行后的数据类型，rtValue表示执行后的结果字符串
	public	int insertMsg2Redis( int msgType, String  szValue, ExecRedisCmdErr  rtValue );
		//将消息状态写入到redis
	public	int insertMsgStatus2Redis( int msgType, String  szValue, ExecRedisCmdErr  rtValue );
		//写入苹果推送消息到redis
	public	int insertIOSPush2Redis(String  szValue, ExecRedisCmdErr  rtValue );
		//短信写入redis
	public	int insertSMS2BroadCast( String  szValue, ExecRedisCmdErr  rtValue );

		//订阅部门，群组，单人
	public	int addSubscriber( long ulUserId, PresenceSubscriber  subscriber, ExecRedisCmdErr  rtValue,String strDeviceType );
		//移出订阅人
	public	int removeSubScriber( long ulUserId, PresenceSubscriber  subscriber, ExecRedisCmdErr  rtValue ,String strDeviceType);

		//写入用户登录的状态
	public	int setUserLoginInfo( long ulUserId, String  loginInfo, ExecRedisCmdErr  rtValue );
		//删除用户登录的状态
	public	int delUserLoginInfo( long ulUserId, ExecRedisCmdErr  rtValue );

		//设置notify的数据
	public	int setNotifyContent( String  hashKeys, String  hashValue, ExecRedisCmdErr  rtValue );
		//删除notify的数据
	public	int delNotifyContent( String  hashKeys, ExecRedisCmdErr  rtValue );
		//设置小应用推送的数据
	public	int setAppMsgContent( String  szValue, ExecRedisCmdErr  rtValue );

		//删除用户登录的sessionid
	public	int deleteUserSession( String  userId, ExecRedisCmdErr  rtValue );
		//删除session
	public	int deleteSession( String  szSession, ExecRedisCmdErr  rtValue );

		//设置iostoken
	public	int setIosTokenByUserid( String  szUserId, String  szIosToken, ExecRedisCmdErr  rtValue );
		//删除iostoken
	public	int delIosTokenByUserId( String  szUserId, ExecRedisCmdErr  rtValue );

		//插入预删除SessionId
	public	int insertPreDelUserSession( String  userid, String  strSessionId, ExecRedisCmdErr  rtValue );

		//插入短信上行的数据
	public	int insertUplinkSmsContent( String  hashId, String  hashValue, ExecRedisCmdErr  rtValue );

		//插入预发送短信内容
	public	int insertPreSendSmsContent( String  szJosn, ExecRedisCmdErr  rtValue );

	//public	void setConnectStatus(int nConnectStatus);
	
	//public	int getConnectStatus();

	
	public	int execCmd2AsyncRedis( String  szCmd );					//保证szValues没有空格的时候,使用这个
	public	int execCmd2AsyncRedis( String  szCmd, String  szKeys, String  szValues );//执行函数,szValues可能有空格
	public	int execCmd2AsyncRedisByBytes( String  szCmd, String  szKeys, String  szValues );
	public	int execCmd2AsyncRedis( String  szCmd, String  szHashName, String  szHashKey,String  szHashValue );

	//public	static void connectAsyncCallback( redisAsyncContext *c, int status );
	//public	static void disconnectAsyncCallback( const redisAsyncContext *c, int status );
	//public	static void insertRedisCallback( redisAsyncContext *c, void *r, void *privdata );
	//public	static void AsyncRedis_reconnect_time_cb(const int fd, const short which, void *arg);
	//public	static void AddReconnectTimer(_WORKER *w, CAsyncR* pAsyncR);
	//public	virtual int Reconnect(const redisAsyncContext *asyncRedis);
	//public	void releaseConn();
	//public	redisAsyncContext *m_asyncRdisContext;							//hiredis的实例化连接
		
//	String m_szServerIp;
//	int m_port;
//	WORKER owner;
//	int m_nConnectStatus;	
}
